package com.ruoyi.invest.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.invest.domain.TbInvestPapers;
import com.ruoyi.invest.service.ITbInvestPapersService;
import com.ruoyi.invest.mapper.TbInvestPapersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86136
* @description 针对表【tb_invest_papers(投资证件表)】的数据库操作Service实现
* @createDate 2023-01-13 11:18:49
*/
@Service
public class TbInvestPapersServiceImpl implements ITbInvestPapersService
{
    @Autowired
    private TbInvestPapersMapper tbInvestPapersMapper;

    /**
     * 查询投资证件
     *
     * @param investPapersId 投资证件主键
     * @return 投资证件
     */
    @Override
    public TbInvestPapers selectTbInvestPapersByInvestPapersId(Long investPapersId)
    {
        return tbInvestPapersMapper.selectTbInvestPapersByInvestPapersId(investPapersId);
    }

    /**
     * 查询投资证件列表
     *
     * @param tbInvestPapers 投资证件
     * @return 投资证件
     */
    @Override
    public List<TbInvestPapers> selectTbInvestPapersList(TbInvestPapers tbInvestPapers)
    {
        return tbInvestPapersMapper.selectTbInvestPapersList(tbInvestPapers);
    }

    /**
     * 新增投资证件
     *
     * @param tbInvestPapers 投资证件
     * @return 结果
     */
    @Override
    public int insertTbInvestPapers(TbInvestPapers tbInvestPapers)
    {
        tbInvestPapers.setCreateTime(DateUtils.getNowDate());
        return tbInvestPapersMapper.insertTbInvestPapers(tbInvestPapers);
    }

    /**
     * 修改投资证件
     *
     * @param tbInvestPapers 投资证件
     * @return 结果
     */
    @Override
    public int updateTbInvestPapers(TbInvestPapers tbInvestPapers)
    {
        tbInvestPapers.setUpdateTime(DateUtils.getNowDate());
        return tbInvestPapersMapper.updateTbInvestPapers(tbInvestPapers);
    }

    /**
     * 批量删除投资证件
     *
     * @param investPapersIds 需要删除的投资证件主键
     * @return 结果
     */
    @Override
    public int deleteTbInvestPapersByInvestPapersIds(Long[] investPapersIds)
    {
        return tbInvestPapersMapper.deleteTbInvestPapersByInvestPapersIds(investPapersIds);
    }

    /**
     * 删除投资证件信息
     *
     * @param investPapersId 投资证件主键
     * @return 结果
     */
    @Override
    public int deleteTbInvestPapersByInvestPapersId(Long investPapersId)
    {
        return tbInvestPapersMapper.deleteTbInvestPapersByInvestPapersId(investPapersId);
    }
}





